Contents | < Browse | Browse >
Custom-windows are another powerful feature of Wildfire.
You can create as much own windows as you want, they can
be loaded, saved, opened, closed, deleted, ... at any time.
So it's possible to create Toolmanager-like docks on the
Wildfire-screen which can be loaded at startup.
But the main purpose is to give you the possibility to enhance
the program easily and to fit it to your needs.
Window-elements
-------------------------------------------------------------------
Custom windows can contain
-buttons
-string-gadgets
-switches
-lines
-boxes and
-texts.
All these elements remain to the window as long as you
don't kill them.
But you have the possibility to apply graphical elements
which are not stored as structures to the window.
So you could create an own progress-bar or a function-plotter..
Attention:
If you want to have spaces in you window- or gadget-names
you have to use a special character (code 160).
(This restriction is due the command-parsing.)
Example:
space='a0'x
wnd="Transition.rexx" || space || "V0.3"
Window-coordinates
-------------------------------------------------------------------
Because Wildfire has a fontsensitve GUI you can't use absolute
coordinates to specify window-elements.
So you have to design your windows using a topaz.8-font
to ensure that they look perfect for example with a times.24-font.
If you want to design a very difficult window with 500
gadgets, 300 bevelboxes, ... it's seems to be no bad idea
to use GadToolsBox¹. Using this nice program you can drag and
size your gadgets in an easy way - just take down the coordinates
after finishing it.
A simple example
-------------------------------------------------------------------
The following example called "ConvertPics.rexx" opens a window
which lets you specify a range of your current picture-list
and has a "Convert"-button. This makes is possible to
convert only a small part of the picture-list which is
very usefull if you want to test a very complex process.
1. Program-structure
(i) create the window, initialize the parameters
(ii) perform an endless loop receiving messages:
1. check for pressed gadgets
-> start filerequester, read gadget-contents
2. check for the closegadget
-> exit
3. check for the start-button
-> check the parameters
-> do it
2. Program
/* Are we right ? */
if ~show('P','Wildfire') then do
say " Error: The Wildfire-program must be started before executing this script."
exit
end
/* Initialize the global variables */
address "Wildfire"
options results
wnd="Convert"
from=1
to=1
/* Create the window */
cw_kill wnd
cw_add wnd 309 70
/* Create the Gadget */
cw_addgadget wnd string 202 11 84 "From"
cw_addgadget wnd string 202 27 84 "To"
cw_addgadget wnd button 25 46 261 "Convert"
/* It's important to open the window before setting the gadgets */
cw_open wnd
cw_setgadget wnd "From" from
cw_setgadget wnd "To" to
/* main loop */
do forever
/* check if the window is still open */
cw_isopen wnd
qt=result
/* no: leave the script */
if qt=0 then call cleanup
/* wait for gadgets */
cw_wait wnd
gadget=result
/* which gadget was pressed */
if gadget="From" then do
/* get the "from"-value from the gadget */
cw_getgadget wnd "From"
from=result
end
else if gadget="To" then do
/* get the "to"-value from the gadget */
cw_getgadget wnd "To"
to=result
end
else if gadget="Convert" then do
/* now let's do it */
c_convertpics from to
end
end
cleanup:
cw_kill wnd
exit
¹ GadToolsBox is Copyright © 1991-93 Jaba Development